package com.summer.service.Impl;

import com.summer.dao.BookDao;
import com.summer.pojo.Book;
import com.summer.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookDao bookDao;
    @Override
    public List<Book> findAllBook() {
        List<Book> bookList = bookDao.findAllBook();
        return bookList;
    }

    @Override
    public Book findBookById(int id) {
        Book book = bookDao.findBookById(id);
        return book;
    }

    @Override
    public int updateBookById(int id, int count) {
        bookDao.updateBookById(id,count);
        return 0;
    }

    @Override
    public int addBook(Book book) {
        bookDao.addBook(book);
        return 0;
    }

    @Override
    public int adminupdateBookById(Book book) {
        bookDao.adminupdateBookById(book);
        return 0;
    }

    @Override
    public int deleteBookById(int bookid) {
        bookDao.deleteBookById(bookid);
        return 0;
    }

}
